package com.xbj.controller;

import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by JzzZ
 * Date: 2018\7\10 0010
 * Time: 14:06
 * Project: News2.0
 * File description:
 */

@Controller
public class MainController {

    @RequestMapping("/menu/{menus}")
    public String menu(@PathVariable(value = "menus") String menus) {
        if ("top".equals(menus)) {
            return "admin/jsp/top";
        }
        if ("left".equals(menus)) {
            return "admin/jsp/left";
        }
        if ("index".equals(menus)) {
            return "admin/jsp/index";
        }
        if ("main".equals(menus)) {
            return "admin/jsp/main";
        }
        return "admin/jsp/main";
    }


    @RequestMapping("/right")
    public String toRight() {
        return "redirect:/newsList?page=1";
    }

    @RequestMapping("/form")
    public String toForm() {
        return "admin/jsp/form";
    }

    @RequestMapping("/tab")
    public String toTab() {
        return "/admin/jsp/tab";
    }

    @RequestMapping("/error")
    public String toError() {
        return "/admin/jsp/error";
    }
}
